Skip to content

Conversation

@BalintCsala
Copy link

Currently the only detected top level files are in the world-1, world0 and world1 folders. Mods can add their own worlds, screwing over shader devs like emin

mod test;

pub fn is_top_level(path: &Path) -> bool {
let path = path.as_os_str().to_str().unwrap().replace("\\", "/");
Copy link
Owner

@Strum355 Strum355 Apr 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can probably replace this with https://docs.rs/path-slash/latest/path_slash/trait.PathExt.html#method.to_slash:

Suggested change
let path = path.as_os_str().to_str().unwrap().replace("\\", "/");
use path_slash::PathExt;
let path = path.to_slash().unwrap();

@BalintCsala
Copy link
Author

@Strum355 Implemented the suggestion

@Strum355 Strum355 merged commit 83c86ae into Strum355:rust-rewrite Apr 29, 2022
@BalintCsala BalintCsala deleted the top_level_check branch April 29, 2022 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants